{{ template "header_" . }}

<h1>Event: <tt>{{ .ID }}</tt></h1>
<button onclick="redispatch()">Redispatch To:</button>
<select id="redispatch">
{{ range $k, $v := .Deployments }}
    <option value="{{ $v }}">{{ $k }}</option>
{{ end }}
</select>
<pre>{{ .EventJSON }}</pre>

<h2>Data</h2>
<div class="jsoneditor">{{ .DataJSON }}</div>

<script>
    function redispatch() {
        const sel = document.getElementById('redispatch').value;
        const encodedSel = encodeURIComponent(sel);

        window.location.href = '/internal/dashboard/events/{{ .ID }}/redispatch?did=' + encodedSel;
    }
</script>

{{ template "footer_" . }}
